// 用var定义变量的时候，用立即执行函数生成块级作用域
/*
(function() {
    var $ = (window.$ = {});
    $.web = "xiasnn";
    var url = "xiasnn.com";
    var site = "大美女";
    $.getURL = function(){
        // return $.web;
        return url;
    }
}.bind(window)());
*/


// 块级作用域,使用let和const定义变量
{
    let $ = (window.$ = {});
    $.web = "xiasnn";
    let url = "xiasnn.com";
    let site = "大美女";
    $.getURL = function(){
        // return $.web;
        return url;
    }
}